﻿#ifndef CADREINFO_H
#define CADREINFO_H

#include <QWidget>
#include <QTableView>
#include <QSqlQueryModel>
#include <QSqlTableModel>
#include <QSqlRecord>
#include "cadremanage/departlist.h"
#include "cadremanage/cadreinfotab.h"
#include "cadremanage/timeeditdelegate.h"
#include "cadremanage/cadrefamilytab.h"
#include "cadremanage/cadreedutab.h"
#include "cadremanage/cadretitletab.h"
#include "cadremanage/cadretraintab.h"
#include "cadremanage/cadrerewardtab.h"
#include "cadremanage/cadrepunishtab.h"
#include "cadremanage/cadreposttab.h"
#include "cadremanage/cadrechecktab.h"
#include "cadremanage/cadreoverviewtab.h"

namespace Ui {
class CadreInfo;
}

class CadreInfo : public QWidget
{
    Q_OBJECT

public:
    explicit CadreInfo(QWidget *parent = 0);
    ~CadreInfo();
    void moveRow(QSqlTableModel *model, int curRow, int toRow);
    void initTableView();
    void allTabFresh(QString);
    QSqlQueryModel *cadreModel;

private slots:
    void on_comboBox_currentIndexChanged(const QString &arg1);

    void on_lockButton_clicked();

    void on_deleteButton_clicked();

    void on_addButton_clicked();

    void on_experAddButton_clicked();

    void on_experDeleteButton_clicked();

    void on_experUpButton_clicked();

    void on_experDownButton_clicked();

//    void on_experCopyButton_clicked();

    void on_searchpushButton1_clicked();

    void on_tabWidget_2_currentChanged(int index);

    void on_outpushButton_clicked();

public slots:
    void on_tableView_clicked(const QModelIndex &index);

private:
    Ui::CadreInfo *ui;
    QString currentPerson;
    int lastIndex;
    QString opFlag;  //修改，增加操作标志
    DepartList *departList;
    CadreInfoTab *cadreinfotab;
    CadreFamilyTab *cadrefamilytab;
    CadreEduTab *cadreedutab1,*cadreedutab2;
    CadreTitleTab *cadretitletab;
    CadreTrainTab *cadretraintab;
    CadreRewardTab *cadrerewardtab;
    CadrePunishTab *cadrepunishtab;
    CadrePostTab *cadreposttab;
    CadreCheckTab *cadrechecktab;
    CadreOverviewTab *cadreoverviewtab;
    QTableView *view;
    // 工作经历
    QSqlTableModel *experModel;
    QString getSql();
    void initExperTableView();
    int curRow;

};

#endif // CADREINFO_H
